<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * down short summary.
 *
 * down description.
 *
 * @version 1.0
 * @author GALAXY
 */
class Down extends Pre_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->Model('Down_model');
    }

    public function Downlist()
    {
        $parentid=$this->uri->segment(3);
        $data['crumbsMenu'] =$this->GetCrumbs($parentid);
        $data['leftNav']=$this->GetLeftNav($parentid); //$this->CreatLeftNav(5);
        $Highlight=array();
        $data['high']= $this->GetLeftNavHighlight($parentid,$Highlight);

        $data['parentid'] =$parentid;
        $this->load->library('pagination');
        $perPage=12;
        $config['base_url']=base_url('down/downlist/'.$parentid);
        $config['per_page']=$perPage;
        $config['total_rows']=$this->Down_model->Get_AllRow_ParentId($parentid); //$this->db->count_all_results('product');
        $config['uri_segment']=4;
        $this->pagination->initialize($config);
        $data['links']=$this->pagination->create_links();
        $offset=$this->uri->segment(4);
        $this->db->limit($perPage,$offset);
        $data['dwonList']=$this->Down_model->Get_DownList_Page_ParentId($parentid);
        $this->load->view('Pre/down/downlist.html',$data);
    }
}